import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 登录界面单独一个
    { path: '/login', component: () => import('@/views/login/LoginPage.vue') },

    {
      //重定向到首页
      path: '/',
      component: () => import('@/views/layout/LayoutContainer.vue'),
      redirect: '@/views/home/HomePage.vue',
      children: [
        {
          path: '/home',
          component: () => import('@/views/home/HomePage.vue')
        },
        {
          path: '/categorize',
          component: () => import('@/views/categorize/CategorizePage.vue')
        },
        {
          path: '/commdity',
          component: () => import('@/views/commodity/CommodityPage.vue')
        },
        {
          path: '/order',
          component: () => import('@/views/order/OrderPage.vue')
        },
        {
          path: '/commdity',
          component: () => import('@/views/payment/PaymentPage.vue')
        },
        {
          path: '/user',
          component: () => import('@/views/user/UserInfo.vue')
        }
      ]
    }
  ]
})

export default router
